<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>轮播图</title>
</head>
<body>
    <img src="../img/travel/banner_1.jpg" id="time">

    <script type="text/javascript">
        var num = 1;

        function changeJpg() {
            if (num === 1){
                time.src = "../img/travel/banner_2.jpg";
                num = 2;
            }else if (num === 2){
                time.src = "../img/travel/banner_3.jpg";
                num = 3;
            }else if (num === 3){
                time.src = "../img/travel/banner_1.jpg";
                num = 1;
            }

        }

        setInterval(changeJpg,3000);

    </script>
</body>
</html>